home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK2.toast / Development Kits (Disc 2) / QuickTime™ VR 2.0 SDK / Documentation + Extras / Updated Interfaces / QuickDraw 3D 1.5 Interfaces / Interfaces / QD3D.h next >
Encoding:
C/C++ Source or Header  |  1997-05-22  |  47.3 KB  |  1,402 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                              **
  3.  **     Module:        QD3D.h                                                     **                        
  4.  **                                                                              **
  5.  **                                                                              **
  6.  **     Purpose:     System include file.                                     **            
  7.  **                                                                              **
  8.  **                                                                              **
  9.  **                                                                              **
  10.  **     Copyright (C) 1992-1996 Apple Computer, Inc.  All rights reserved.     **
  11.  **                                                                              **
  12.  **                                                                              **
  13.  *****************************************************************************/
  14. #ifndef QD3D_h
  15. #define QD3D_h
  16.  
  17. #include <stdio.h>
  18.  
  19. /*
  20.  *
  21.  *  A B O U T   Q D 3 D _ O B S O L E T E:
  22.  *
  23.  *
  24.  *  NOTE:the flag QD3D_OBSOLETE is used to mark API calls that are being
  25.  *       deprecated.  This means we intend to remove them in the future.
  26.  *         If you define the name QD3D_OBSOLETE then the "old" API calls will
  27.  *         still work.  We recommend switching to the new versions of these
  28.  *         calls for maximum compatibility.  If you want to enable the flag
  29.  *         then you should set its value to 1 (true).  For example if you use
  30.  *         a prefix file then you could place the following line in it:
  31.  *
  32.  *            #define QD3D_OBSOLETE    1
  33.  *
  34.  *         or if your compiler accepts the -d option, on your compile line add
  35.  *
  36.  *            -d QD3D_OBSOLETE=1
  37.  *
  38.  *         to your compile line.
  39.  */ 
  40.  
  41. /******************************************************************************
  42.  **                                                                             **
  43.  **                                Porting Control                                 **
  44.  **                                                                             **
  45.  *****************************************************************************/
  46.  
  47. /*
  48.  *  NOTE:  To compile on a Unix workstation (assumes X11 window system):
  49.  *                1. Add to compiler command line: "-DOS_MACINTOSH=0"
  50.  *                2. Add "-DOS_UNIX=1"
  51.  *                3. Add "-DWINDOW_SYSTEM_X11=1"
  52.  */
  53. #if defined(_WIN32) || defined(_WINDOWS)
  54.     #define OS_MACINTOSH                0
  55.     #define OS_WIN32                    1
  56.     #define OS_UNIX                        0
  57.  
  58.     #define WINDOW_SYSTEM_MACINTOSH        0
  59.     #define WINDOW_SYSTEM_WIN32            1
  60.     #define WINDOW_SYSTEM_X11            0
  61. #elif !defined(OS_MACINTOSH)
  62.     #define OS_MACINTOSH                1
  63.     #define OS_WIN32                    0
  64.     #define OS_UNIX                        0
  65.  
  66.     #define WINDOW_SYSTEM_MACINTOSH        1
  67.     #define WINDOW_SYSTEM_WIN32            0
  68.     #define WINDOW_SYSTEM_X11            0
  69.  
  70.     #if defined(THINK_C) || defined(__SC__) || defined(__MWERKS__)
  71.          #define PRAGMA_ONCE                1
  72.     #else
  73.          #define PRAGMA_ONCE                0
  74.     #endif  /*  defined(THINK_C) || defined(__SC__) || defined(__MWERKS__)  */
  75.  
  76.     /*
  77.      *  Set required compiler options (if possible):
  78.      *   1. enums must always be ints in QD3D and in applications;
  79.      *      this consistency is required to prevent misinterpretation
  80.      *      of an app's enum values by an API; it is also required for
  81.      *      compliance with ANSI
  82.      *   2. alignment of char and short arrays in structures is not on
  83.      *      long boundaries; (could be other way, but must be consistent
  84.      *      in QD3D and in applications)
  85.      *   3. alignment of longs, floats, and pointers in structures
  86.      *      is on long boundaries for PowerPC
  87.      */
  88.     #if defined(THINK_C) || defined(__SC__)
  89.         #pragma options(!pack_enums, !align_arrays)
  90.         #pragma SC options align=power
  91.     #elif defined(__MWERKS__)
  92.         #pragma enumsalwaysint on
  93.         #pragma align_array_members off
  94.         #pragma options align=native
  95.     #elif defined(__PPCC__)
  96.         #pragma options align=power
  97.     #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  98.         #pragma options enum=int
  99.     #endif
  100.     
  101.     enum {
  102.         gestaltQD3D                = 'qd3d',
  103.         gestaltQD3DVersion        = 'q3v ',
  104.         gestaltQD3DNotPresent    = 0,
  105.         gestaltQD3DAvailable    = 1
  106.     };
  107.     
  108. #endif  /*  OS_MACINTOSH  */
  109.  
  110. #if defined(PRAGMA_ONCE) && PRAGMA_ONCE
  111.     #pragma once
  112. #endif  /*  PRAGMA_ONCE  */ 
  113.  
  114.  
  115. /******************************************************************************
  116.  **                                                                             **
  117.  **                                Export Control                                 **
  118.  **                                                                             **
  119.  *****************************************************************************/
  120.  
  121. #if defined(_MSC_VER)    /* Microsoft Visual C */
  122.     #if defined(WIN32_EXPORTING)    /* define when building DLL */
  123.         #define QD3D_EXPORT __declspec( dllexport )     
  124.         #define QD3D_CALL    
  125.         #define QD3D_CALLBACK    
  126.     #else
  127.         #define QD3D_EXPORT __declspec( dllimport )    
  128.         #define QD3D_CALL    __cdecl
  129.         #define QD3D_CALLBACK    __cdecl    
  130.     #endif /* WIN32_EXPORTING */
  131. #else
  132.     #define QD3D_EXPORT
  133.     #define QD3D_CALL    
  134.     #define QD3D_CALLBACK    
  135. #endif  /*  _MSC_VER  */
  136.  
  137.  
  138. /******************************************************************************
  139.  **                                                                             **
  140.  **                                NULL definition                                 **
  141.  **                                                                             **
  142.  *****************************************************************************/
  143.  
  144. #ifndef NULL
  145. #error NULL is undefined.
  146. #endif /* NULL */
  147.  
  148.  
  149. /******************************************************************************
  150.  **                                                                             **
  151.  **                                    Objects                                     **
  152.  **                                                                             **
  153.  *****************************************************************************/
  154. /*
  155.  * Everything in QuickDraw 3D is an OBJECT: a bunch of data with a type,
  156.  * deletion, duplication, and i/o methods.
  157.  */
  158. typedef long                    TQ3ObjectType;
  159.  
  160. typedef struct TQ3ObjectPrivate    *TQ3Object;
  161.  
  162. /*
  163.  * There are four subclasses of OBJECT:
  164.  *    an ELEMENT, which is data that is placed in a SET
  165.  *    a SHAREDOBJECT, which is reference-counted data that is shared
  166.  *    VIEWs, which maintain state information for an image
  167.  *    a PICK, which used to query a VIEW
  168.  */
  169. typedef TQ3Object                TQ3ElementObject;
  170. typedef TQ3Object                TQ3SharedObject;
  171. typedef TQ3Object                TQ3ViewObject;
  172. typedef TQ3Object                TQ3PickObject;
  173.  
  174. /*
  175.  * There are several types of SharedObjects:
  176.  *    RENDERERs, which paint to a drawContext
  177.  *    DRAWCONTEXTs, which are an interface to a device 
  178.  *    SETs, which maintains "mathematical sets" of ELEMENTs
  179.  *    FILEs, which maintain state information for a metafile
  180.  *    SHAPEs, which affect the state of the View
  181.  *    SHAPEPARTs, which contain geometry-specific data about a picking hit
  182.  *    CONTROLLERSTATEs, which hold state of the output channels for a CONTROLLER
  183.  *    TRACKERs, which represent a position and orientation in the user interface
  184.  *  STRINGs, which are abstractions of text string data.
  185.  *    STORAGE, which is an abstraction for stream-based data storage (files, 
  186.  *        memory)
  187.  *    TEXTUREs, for sharing bitmap information for TEXTURESHADERS
  188.  *    VIEWHINTs, which specifies viewing preferences in FILEs
  189.  */
  190. typedef TQ3SharedObject            TQ3RendererObject;
  191. typedef TQ3SharedObject            TQ3DrawContextObject;
  192. typedef TQ3SharedObject            TQ3SetObject;
  193. typedef TQ3SharedObject            TQ3FileObject;
  194. typedef TQ3SharedObject            TQ3ShapeObject;
  195. typedef TQ3SharedObject            TQ3ShapePartObject;
  196. typedef TQ3SharedObject            TQ3ControllerStateObject;
  197. typedef TQ3SharedObject            TQ3TrackerObject;
  198. typedef TQ3SharedObject            TQ3StringObject;
  199. typedef TQ3SharedObject            TQ3StorageObject;
  200. typedef TQ3SharedObject            TQ3TextureObject;
  201. typedef TQ3SharedObject            TQ3ViewHintsObject;
  202.  
  203. #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  204. /*
  205.  * (and for QuickDraw 3D 1.5)
  206.  *    DEEPBUFFERs, which cache a lot of rasterized information for
  207.  *  deferred interactive imaging.
  208.  *    ATTACHMENTs, for adding parametrizations to geometries
  209.  */
  210. typedef TQ3SharedObject            TQ3DeepBufferObject;
  211. typedef TQ3SharedObject            TQ3AttachmentObject;
  212. #endif  /*  ESCHER_VER_FUTURE  */
  213.  
  214. /*
  215.  * There is one types of SET:
  216.  *    ATTRIBUTESETs, which contain ATTRIBUTEs which are inherited 
  217.  */
  218. typedef TQ3SetObject                TQ3AttributeSet;
  219.  
  220. /*
  221.  * There are many types of SHAPEs:
  222.  *    LIGHTs, which affect how the RENDERER draws 3-D cues
  223.  *    CAMERAs, which affects the location and orientation of the RENDERER in 
  224.  *        space
  225.  *    GROUPs, which may contain any number of SHARED OBJECTS
  226.  *    GEOMETRYs, which are representations of three-dimensional data
  227.  *    SHADERs, which affect how colors are drawn on a geometry
  228.  *    STYLEs, which affect how the RENDERER paints to the DRAWCONTEXT
  229.  *    TRANSFORMs, which affect the coordinate system in the VIEW
  230.  *    REFERENCEs, which are references to objects in FILEs
  231.  *  UNKNOWN, which hold unknown objects read from a metafile.
  232.  */
  233. typedef TQ3ShapeObject            TQ3GroupObject;
  234. typedef TQ3ShapeObject            TQ3GeometryObject;
  235. typedef TQ3ShapeObject            TQ3ShaderObject;
  236. typedef TQ3ShapeObject            TQ3StyleObject;
  237. typedef TQ3ShapeObject            TQ3TransformObject;
  238. typedef TQ3ShapeObject            TQ3LightObject;
  239. typedef TQ3ShapeObject            TQ3CameraObject;
  240. typedef TQ3ShapeObject            TQ3UnknownObject;
  241. typedef TQ3ShapeObject            TQ3ReferenceObject;
  242.  
  243. /*
  244.  * For now, there is only one type of SHAPEPARTs:
  245.  *    MESHPARTs, which describe some part of a mesh
  246.  */
  247. typedef TQ3ShapePartObject        TQ3MeshPartObject;
  248.  
  249. /*
  250.  * There are three types of MESHPARTs:
  251.  *    MESHFACEPARTs, which describe a face of a mesh
  252.  *    MESHEDGEPARTs, which describe a edge of a mesh
  253.  *    MESHVERTEXPARTs, which describe a vertex of a mesh
  254.  */
  255. typedef TQ3MeshPartObject        TQ3MeshFacePartObject;
  256. typedef TQ3MeshPartObject        TQ3MeshEdgePartObject;
  257. typedef TQ3MeshPartObject        TQ3MeshVertexPartObject;
  258.  
  259. /*
  260.  * A DISPLAY Group can be drawn to a view
  261.  */
  262. typedef TQ3GroupObject            TQ3DisplayGroupObject;
  263.  
  264. /*
  265.  * There are many types of SHADERs:
  266.  *    SURFACESHADERs, which affect how the surface of a geometry is painted
  267.  *    ILLUMINATIONSHADERs, which affect how lights affect the color of a surface
  268.  */
  269. typedef TQ3ShaderObject            TQ3SurfaceShaderObject;
  270. typedef TQ3ShaderObject            TQ3IlluminationShaderObject;
  271.  
  272. /*
  273.  * A handle to an object in a group
  274.  */
  275. typedef struct TQ3GroupPositionPrivate    *TQ3GroupPosition;
  276.  
  277. /* 
  278.  * TQ3ObjectClassNameString is used for the class name of an object
  279.  */
  280. enum {
  281.     kQ3StringMaximumLength = 1024
  282. };
  283.  
  284. typedef char TQ3ObjectClassNameString[kQ3StringMaximumLength];
  285.  
  286. /******************************************************************************
  287.  **                                                                             **
  288.  **                            Client/Server Things                             **
  289.  **                                                                             **
  290.  *****************************************************************************/
  291.  
  292. typedef void *TQ3ControllerRef;
  293.  
  294.  
  295. /******************************************************************************
  296.  **                                                                             **
  297.  **                            Flags and Switches                                 **
  298.  **                                                                             **
  299.  *****************************************************************************/
  300.  
  301. typedef enum TQ3Boolean {
  302.     kQ3False,
  303.     kQ3True
  304. } TQ3Boolean;
  305.  
  306. typedef enum TQ3Switch {
  307.     kQ3Off,
  308.     kQ3On
  309. } TQ3Switch;
  310.  
  311. typedef enum TQ3Status {
  312.     kQ3Failure,
  313.     kQ3Success
  314. } TQ3Status;
  315.  
  316. typedef enum TQ3Axis {
  317.     kQ3AxisX,
  318.     kQ3AxisY,
  319.     kQ3AxisZ
  320. } TQ3Axis;
  321.  
  322. typedef enum TQ3PixelType {
  323.     kQ3PixelTypeRGB32        = 0,    /* Alpha:8 (ignored), R:8, G:8, B:8    */
  324.     kQ3PixelTypeARGB32        = 1,    /* Alpha:8, R:8, G:8, B:8             */
  325.     kQ3PixelTypeRGB16        = 2,    /* Alpha:1 (ignored), R:5, G:5, B:5    */
  326.     kQ3PixelTypeARGB16        = 3        /* Alpha:1, R:5, G:5, B:5             */
  327. #if defined(WINDOW_SYSTEM_WIN32) && WINDOW_SYSTEM_WIN32
  328.     ,
  329.     kQ3PixelTypeRGB16_565    = 4,    /* 16 bits/pixel, R:5, G:6, B:5        */
  330.     kQ3PixelTypeRGB24        = 5        /* 24 bits/pixel, R:8, G:8, B:8        */
  331. #endif /* WINDOW_SYSTEM_WIN32 */
  332. #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  333.     ,
  334.     kQ3PixelTypeCL8            = 6,    /* 8-bit color table index            */
  335.     kQ3PixelTypeCL4            = 7,    /* 4-bit color table index            */
  336.     kQ3PixelTypeAlpha1        = 8        /* alpha                            */
  337. #endif /* ESCHER_VER_FUTURE */
  338. } TQ3PixelType;
  339.  
  340. typedef enum TQ3Endian{
  341.     kQ3EndianBig,
  342.     kQ3EndianLittle
  343. } TQ3Endian;
  344.  
  345. typedef enum TQ3EndCapMasks {
  346.     kQ3EndCapNone            = 0,
  347.     kQ3EndCapMaskTop        = 1 << 0,
  348.     kQ3EndCapMaskBottom        = 1 << 1,
  349.     kQ3EndCapMaskInterior    = 1 << 2
  350. } TQ3EndCapMasks;
  351.  
  352. typedef unsigned long TQ3EndCap;
  353.  
  354. enum {
  355.     kQ3ArrayIndexNULL = ~0
  356. };
  357.  
  358.  
  359. /******************************************************************************
  360.  **                                                                             **
  361.  **                        Point and Vector Definitions                         **
  362.  **                                                                             **
  363.  *****************************************************************************/
  364.  
  365. typedef struct TQ3Vector2D {
  366.     float        x;
  367.     float        y;
  368. } TQ3Vector2D;
  369.  
  370. typedef struct TQ3Vector3D {
  371.     float         x;
  372.     float        y;
  373.     float        z;
  374. } TQ3Vector3D;
  375.  
  376. typedef struct TQ3Point2D {
  377.     float        x;
  378.     float        y;
  379. } TQ3Point2D;
  380.  
  381. typedef struct TQ3Point3D {
  382.     float         x;
  383.     float        y;
  384.     float        z;
  385. } TQ3Point3D;
  386.  
  387. typedef struct TQ3RationalPoint4D {
  388.     float         x;
  389.     float        y;
  390.     float        z;
  391.     float        w;
  392. } TQ3RationalPoint4D;
  393.  
  394. typedef struct TQ3RationalPoint3D {
  395.     float        x;
  396.     float        y;
  397.     float        w;
  398. } TQ3RationalPoint3D;
  399.  
  400.  
  401. /******************************************************************************
  402.  **                                                                             **
  403.  **                                Quaternion                                     **
  404.  **                                                                             **
  405.  *****************************************************************************/
  406.  
  407. typedef struct TQ3Quaternion {
  408.     float        w;
  409.     float        x;
  410.     float        y;
  411.     float        z;
  412. } TQ3Quaternion;
  413.  
  414.  
  415. /******************************************************************************
  416.  **                                                                             **
  417.  **                                Ray Definition                                 **
  418.  **                                                                             **
  419.  *****************************************************************************/
  420.  
  421. typedef struct TQ3Ray3D {
  422.     TQ3Point3D        origin;
  423.     TQ3Vector3D        direction;
  424. } TQ3Ray3D;
  425.  
  426.  
  427. /******************************************************************************
  428.  **                                                                             **
  429.  **                        Parameterization Data Structures                     **
  430.  **                                                                             **
  431.  *****************************************************************************/
  432.  
  433. typedef struct TQ3Param2D {
  434.     float            u;
  435.     float            v;
  436. } TQ3Param2D;
  437.  
  438. typedef struct TQ3Param3D {
  439.     float            u;
  440.     float            v;
  441.     float            w;
  442. } TQ3Param3D;
  443.  
  444. typedef struct TQ3Tangent2D {
  445.     TQ3Vector3D        uTangent;
  446.     TQ3Vector3D        vTangent;
  447. } TQ3Tangent2D;
  448.  
  449. typedef struct TQ3Tangent3D {
  450.     TQ3Vector3D        uTangent;
  451.     TQ3Vector3D        vTangent;
  452.     TQ3Vector3D        wTangent;
  453. } TQ3Tangent3D;
  454.  
  455.  
  456. /******************************************************************************
  457.  **                                                                             **
  458.  **                        Polar and Spherical Coordinates                         **
  459.  **                                                                             **
  460.  *****************************************************************************/
  461.  
  462.  typedef struct TQ3PolarPoint {
  463.      float        r;
  464.      float        theta;
  465.   } TQ3PolarPoint;
  466.  
  467.  typedef struct TQ3SphericalPoint {
  468.      float        rho;
  469.      float        theta;
  470.      float        phi;
  471.  } TQ3SphericalPoint;
  472.  
  473.  
  474. /******************************************************************************
  475.  **                                                                             **
  476.  **                            Color Definition                                 **
  477.  **                                                                             **
  478.  *****************************************************************************/
  479.  
  480. typedef struct TQ3ColorRGB {
  481.     float             r;
  482.     float            g;
  483.     float            b;
  484. } TQ3ColorRGB;
  485.  
  486.  
  487. typedef struct TQ3ColorARGB {
  488.     float             a;
  489.     float             r;
  490.     float            g;
  491.     float            b;
  492. } TQ3ColorARGB;
  493.  
  494.  
  495. /******************************************************************************
  496.  **                                                                             **
  497.  **                                    Vertices                                 **
  498.  **                                                                             **
  499.  *****************************************************************************/
  500.  
  501. typedef struct TQ3Vertex3D {
  502.     TQ3Point3D            point;
  503.     TQ3AttributeSet        attributeSet;
  504. }  TQ3Vertex3D;
  505.  
  506.  
  507. /******************************************************************************
  508.  **                                                                             **
  509.  **                                    Matrices                                 **
  510.  **                                                                             **
  511.  *****************************************************************************/
  512.  
  513. typedef struct TQ3Matrix3x3 {
  514.     float    value[3][3];
  515. } TQ3Matrix3x3;
  516.  
  517. typedef struct TQ3Matrix4x4 {
  518.     float    value[4][4];
  519. } TQ3Matrix4x4;
  520.  
  521.  
  522. /******************************************************************************
  523.  **                                                                             **
  524.  **                                Color Table                                     **
  525.  **                                                                             **
  526.  *****************************************************************************/
  527.  
  528. #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  529.  
  530. typedef unsigned long TQ3ColorRGB32;        /* A:8 (ignored), R:8, G:8, B:8 */
  531.  
  532. typedef enum TQ3ColorTableType {
  533.     kQ3ColorTableType_CL8_RGB32        = 0,    /* 256 entries of TQ3ColorRGB32    */
  534.     kQ3ColorTableType_CL4_RGB32        = 1        /* 16 entries of TQ3ColorRGB32    */
  535. } TQ3ColorTableType;
  536.  
  537. typedef struct TQ3ColorTableData {
  538.     TQ3ColorTableType        colorTableType;
  539.     TQ3Boolean                hasTransparent;    /* true if index zero is transp.*/
  540.     TQ3ColorRGB32            colors[256];    /* actual # determined from type*/
  541. } TQ3ColorTableData;
  542.  
  543. typedef TQ3SharedObject    TQ3ColorTableObject;
  544.  
  545. #endif /* ESCHER_VER_FUTURE */
  546.  
  547.  
  548. /******************************************************************************
  549.  **                                                                             **
  550.  **                                Bitmap/Pixmap                                 **
  551.  **                                                                             **
  552.  *****************************************************************************/
  553.  
  554. typedef struct TQ3Pixmap {
  555.     void                *image;
  556.     unsigned long        width;
  557.     unsigned long        height;
  558.     unsigned long        rowBytes;
  559.     unsigned long        pixelSize;    /* MUST be 16 or 32 to use with the         */
  560.                                     /* Interactive Renderer on Mac OS         */
  561.     TQ3PixelType        pixelType;
  562.     TQ3Endian            bitOrder;
  563.     TQ3Endian            byteOrder;
  564. } TQ3Pixmap;
  565.  
  566. typedef struct TQ3StoragePixmap {
  567.     TQ3StorageObject    image;
  568.     unsigned long        width;
  569.     unsigned long        height;
  570.     unsigned long        rowBytes;
  571.     unsigned long        pixelSize;    /* MUST be 16 or 32 to use with the     */
  572.                                     /* Interactive Renderer on Mac OS        */
  573.     TQ3PixelType        pixelType;
  574.     TQ3Endian            bitOrder;
  575.     TQ3Endian            byteOrder;
  576. } TQ3StoragePixmap;
  577.  
  578. typedef struct TQ3Bitmap {
  579.     unsigned char        *image;
  580.     unsigned long        width;
  581.     unsigned long        height;
  582.     unsigned long        rowBytes;
  583.     TQ3Endian            bitOrder;
  584. } TQ3Bitmap;
  585.  
  586. typedef struct TQ3MipmapImage {        /* An image for use as a texture mipmap  */
  587.     unsigned long        width;        /* Width of mipmap, must be power of 2   */
  588.     unsigned long        height;        /* Height of mipmap, must be power of 2  */
  589.     unsigned long        rowBytes;    /* Rowbytes of mipmap                    */
  590.     unsigned long        offset;        /* Offset from image base to this mipmap */
  591. } TQ3MipmapImage;
  592.  
  593. typedef struct TQ3Mipmap {
  594.     TQ3StorageObject    image;        /* Data containing the texture map and     */
  595.                                     /* if (useMipmapping==kQ3True) the         */
  596.                                     /* mipmap data                             */
  597.     TQ3Boolean            useMipmapping;/* True if mipmapping should be used     */
  598.                                     /* and all mipmaps have been provided   */
  599.     TQ3PixelType        pixelType;
  600.     TQ3Endian            bitOrder;
  601.     TQ3Endian            byteOrder;
  602. #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  603.     TQ3ColorTableObject    colorTable;
  604. #else
  605.     unsigned long        reserved;    /* leave NULL for next version */
  606. #endif /* ESCHER_VER_FUTURE */
  607.     TQ3MipmapImage        mipmaps[32];/* The actual number of mipmaps is         */
  608.                                     /* determined from the size of the         */
  609.                                     /* first mipmap                            */
  610. } TQ3Mipmap;
  611.  
  612.  
  613. /******************************************************************************
  614.  **                                                                             **
  615.  **                        Higher dimension quantities                             **
  616.  **                                                                             **
  617.  *****************************************************************************/
  618.  
  619. typedef struct TQ3Area {
  620.     TQ3Point2D             min;
  621.     TQ3Point2D             max;
  622. } TQ3Area;
  623.  
  624. typedef struct TQ3PlaneEquation {
  625.     TQ3Vector3D            normal;
  626.     float                constant;
  627. } TQ3PlaneEquation;
  628.  
  629. typedef struct TQ3BoundingBox {
  630.     TQ3Point3D             min;
  631.     TQ3Point3D             max;
  632.     TQ3Boolean            isEmpty;
  633. } TQ3BoundingBox;
  634.  
  635. typedef struct TQ3BoundingSphere {
  636.     TQ3Point3D            origin;
  637.     float                radius;
  638.     TQ3Boolean            isEmpty;
  639. } TQ3BoundingSphere;
  640.  
  641. /*
  642.  *    The TQ3ComputeBounds flag passed to StartBoundingBox or StartBoundingSphere
  643.  *    calls in the View. It's a hint to the system as to how it should 
  644.  *    compute the bbox of a shape:
  645.  *
  646.  *    kQ3ComputeBoundsExact:    
  647.  *        Vertices of shapes are transformed into world space and
  648.  *        the world space bounding box is computed from them.  Slow!
  649.  *    
  650.  *    kQ3ComputeBoundsApproximate: 
  651.  *        A local space bounding box is computed from a shape's
  652.  *        vertices.  This bbox is then transformed into world space,
  653.  *        and its bounding box is taken as the shape's approximate
  654.  *        bbox.  Fast but the bbox is larger than optimal.
  655.  */
  656. typedef enum TQ3ComputeBounds {
  657.     kQ3ComputeBoundsExact,
  658.     kQ3ComputeBoundsApproximate
  659. } TQ3ComputeBounds;
  660.  
  661.  
  662. /******************************************************************************
  663.  **                                                                             **
  664.  **                            Object System Types                                 **
  665.  **                                                                             **
  666.  *****************************************************************************/
  667.  
  668. #if defined(QD3D_OBSOLETE) && QD3D_OBSOLETE
  669. typedef struct TQ3ObjectClassPrivate        *TQ3ObjectClass;
  670.  
  671. typedef unsigned long                         TQ3MethodType;
  672.  
  673. /*
  674.  * Object methods
  675.  */
  676. #define kQ3MethodTypeObjectUnregister        Q3_METHOD_TYPE('u','n','r','g')
  677.  
  678. /*
  679.  * IO Methods
  680.  */
  681. #define kQ3MethodTypeObjectFileVersion    Q3_METHOD_TYPE('v','e','r','s') /* version */
  682. #define kQ3MethodTypeObjectTraverse        Q3_METHOD_TYPE('t','r','v','s') /* byte count */
  683. #define kQ3MethodTypeObjectTraverseData    Q3_METHOD_TYPE('t','r','v','d') /* byte count */
  684. #define kQ3MethodTypeObjectWrite        Q3_METHOD_TYPE('w','r','i','t') /* Dump info to file */
  685. #define kQ3MethodTypeObjectReadData        Q3_METHOD_TYPE('r','d','d','t') /* Read info from file into buffer or, attach read data to parent */ 
  686.  
  687. typedef void (QD3D_CALLBACK *TQ3FunctionPointer)(
  688.     void);
  689.  
  690. typedef TQ3FunctionPointer (QD3D_CALLBACK *TQ3MetaHandler)(
  691.     TQ3MethodType        methodType);
  692.  
  693. /*
  694.  * MetaHandler:
  695.  *        When you give a metahandler to QuickDraw 3D, it is called multiple 
  696.  *        times to build method tables, and then is thrown away. You are 
  697.  *        guaranteed that your metahandler will never be called again after a 
  698.  *        call that was passed a metahandler returns.
  699.  *
  700.  *        Your metahandler should contain a switch on the methodType passed to it
  701.  *        and should return the corresponding method as an TQ3XFunctionPointer.
  702.  *
  703.  *        IMPORTANT: A metaHandler MUST always "return" a value. If you are
  704.  *        passed a methodType that you do not understand, ALWAYS return NULL.
  705.  *
  706.  *        These types here are prototypes of how your functions should look.
  707.  */
  708. typedef TQ3Status (QD3D_CALLBACK *TQ3ObjectUnregisterMethod)(
  709.     TQ3ObjectClass        objectClass);
  710.     
  711. #endif  /*  QD3D_OBSOLETE  */
  712.  
  713.  
  714. typedef struct TQ3ObjectClassPrivate        *TQ3XObjectClass;
  715.  
  716. typedef unsigned long                         TQ3XMethodType;
  717.  
  718. /*
  719.  * Object methods
  720.  */
  721. #define kQ3XMethodTypeObjectUnregister        Q3_METHOD_TYPE('u','n','r','g')
  722. #define kQ3XMethodTypeObjectIsDrawable        Q3_METHOD_TYPE('i','s','d','r')    /* return true from the metahandler if this 
  723.                                                                              * object can be submitted in a rendering loop 
  724.                                                                              */
  725. typedef void (QD3D_CALLBACK *TQ3XFunctionPointer)(
  726.     void);
  727.  
  728. typedef TQ3XFunctionPointer (QD3D_CALLBACK *TQ3XMetaHandler)(
  729.     TQ3XMethodType        methodType);
  730.  
  731. /*
  732.  * MetaHandler:
  733.  *        When you give a metahandler to QuickDraw 3D, it is called multiple 
  734.  *        times to build method tables, and then is thrown away. You are 
  735.  *        guaranteed that your metahandler will never be called again after a 
  736.  *        call that was passed a metahandler returns.
  737.  *
  738.  *        Your metahandler should contain a switch on the methodType passed to it
  739.  *        and should return the corresponding method as an TQ3XFunctionPointer.
  740.  *
  741.  *        IMPORTANT: A metaHandler MUST always "return" a value. If you are
  742.  *        passed a methodType that you do not understand, ALWAYS return NULL.
  743.  *
  744.  *        These types here are prototypes of how your functions should look.
  745.  */
  746. typedef TQ3Status (QD3D_CALLBACK *TQ3XObjectUnregisterMethod)(
  747.     TQ3XObjectClass        objectClass);
  748.     
  749. /*
  750.  * See QD3DIO.h for the IO method types: 
  751.  *        ObjectReadData, ObjectTraverse, ObjectWrite
  752.  */
  753.  
  754.  
  755. /******************************************************************************
  756.  **                                                                             **
  757.  **                                Set Types                                     **
  758.  **                                                                             **
  759.  *****************************************************************************/
  760.  
  761. typedef long                    TQ3ElementType;
  762.  
  763. #define kQ3ElementTypeNone        0
  764. #define kQ3ElementTypeUnknown    32
  765. #define kQ3ElementTypeSet        33
  766. #define kQ3ElementTypeName        34
  767. #define kQ3ElementTypeURL        35
  768.  
  769. /* 
  770.  *    kQ3ElementTypeUnknown is a TQ3Object. 
  771.  *    
  772.  *        Do Q3Set_Add(s, ..., &obj) or Q3Set_Get(s, ..., &obj);
  773.  *        
  774.  *        Note that the object is always referenced when copying around. 
  775.  *        
  776.  *        Generally, it is an Unknown object, a Group of Unknown objects, or a 
  777.  *        group of other "objects" which have been found in the metafile and
  778.  *        have no attachment method to their parent. Be prepared to handle
  779.  *        any or all of these cases if you actually access the set on a shape.
  780.  *
  781.  *    kQ3ElementTypeSet is a TQ3SetObject. 
  782.  *    
  783.  *        Q3Shape_GetSet(s,&o) is eqivalent to 
  784.  *            Q3Shape_GetElement(s, kQ3ElementTypeSet, &o)
  785.  *            
  786.  *        Q3Shape_SetSet(s,o)  is eqivalent to 
  787.  *            Q3Shape_SetElement(s, kQ3ElementTypeSet, &o)
  788.  *    
  789.  *        Note that the object is always referenced when copying around. 
  790.  *        
  791.  *    See the note below about the Set and Shape changes.
  792.  */
  793.  
  794. /******************************************************************************
  795.  **                                                                             **
  796.  **                            Object System Macros                             **
  797.  **                                                                             **
  798.  *****************************************************************************/
  799.  
  800. #define Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d)         \
  801.             ((const unsigned long)                     \
  802.             ((const unsigned long) (a) << 24) |     \
  803.             ((const unsigned long) (b) << 16) |        \
  804.             ((const unsigned long) (c) << 8)  |     \
  805.             ((const unsigned long) (d)))
  806.  
  807. #define Q3_OBJECT_TYPE(a,b,c,d) \
  808.     ((TQ3ObjectType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  809.  
  810. #if defined(QD3D_OBSOLETE) && QD3D_OBSOLETE    
  811. #define Q3_METHOD_TYPE(a,b,c,d) \
  812.     ((TQ3MethodType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  813. #else
  814. #define Q3_METHOD_TYPE(a,b,c,d) \
  815.     ((TQ3XMethodType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  816.  
  817. #endif  /*  QD3D_OBSOLETE  */
  818.  
  819.  
  820. /******************************************************************************
  821.  **                                                                             **
  822.  **                                Object Types                                 **
  823.  **                                                                             **
  824.  *****************************************************************************/
  825.  
  826. /*
  827.  * Note:    a call to Q3Foo_GetType will return a value kQ3FooTypeBar
  828.  *            e.g. Q3Shared_GetType(object) returns kQ3SharedTypeShape, etc.
  829.  */
  830. #define kQ3ObjectTypeInvalid                            0L
  831. #define kQ3ObjectTypeView                                Q3_OBJECT_TYPE('v','i','e','w')
  832. #define kQ3ObjectTypeElement                            Q3_OBJECT_TYPE('e','l','m','n')
  833.     #define kQ3ElementTypeAttribute                        Q3_OBJECT_TYPE('e','a','t','t')
  834. #define kQ3ObjectTypePick                                Q3_OBJECT_TYPE('p','i','c','k')
  835.     #define kQ3PickTypeWindowPoint                        Q3_OBJECT_TYPE('p','k','w','p')
  836.     #define kQ3PickTypeWindowRect                        Q3_OBJECT_TYPE('p','k','w','r')
  837.     #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  838.     #define kQ3PickTypeBox                                Q3_OBJECT_TYPE('p','k','b','x')
  839.     #define kQ3PickTypeRay                                Q3_OBJECT_TYPE('p','k','r','y')
  840.     #define kQ3PickTypeSphere                            Q3_OBJECT_TYPE('p','k','s','p')
  841.     #endif  /*  ESCHER_VER_FUTURE  */
  842. #define kQ3ObjectTypeShared                                Q3_OBJECT_TYPE('s','h','r','d')
  843.     #define kQ3SharedTypeRenderer                        Q3_OBJECT_TYPE('r','d','d','r')
  844.         #define kQ3RendererTypeWireFrame                Q3_OBJECT_TYPE('w','r','f','r')
  845.         #define kQ3RendererTypeGeneric                    Q3_OBJECT_TYPE('g','n','r','r')
  846.         #define kQ3RendererTypeInteractive                Q3_OBJECT_TYPE('c','t','w','n')
  847.     #define kQ3SharedTypeShape                            Q3_OBJECT_TYPE('s','h','a','p')
  848.         #define kQ3ShapeTypeGeometry                    Q3_OBJECT_TYPE('g','m','t','r')
  849.             #define kQ3GeometryTypeBox                    Q3_OBJECT_TYPE('b','o','x',' ')
  850.             #define kQ3GeometryTypeGeneralPolygon        Q3_OBJECT_TYPE('g','p','g','n')
  851.             #define kQ3GeometryTypeLine                    Q3_OBJECT_TYPE('l','i','n','e')
  852.             #define kQ3GeometryTypeMarker                Q3_OBJECT_TYPE('m','r','k','r')
  853.             #define kQ3GeometryTypePixmapMarker            Q3_OBJECT_TYPE('m','r','k','p')
  854.             #define kQ3GeometryTypeMesh                    Q3_OBJECT_TYPE('m','e','s','h')
  855.             #define kQ3GeometryTypeNURBCurve            Q3_OBJECT_TYPE('n','r','b','c')
  856.             #define kQ3GeometryTypeNURBPatch            Q3_OBJECT_TYPE('n','r','b','p')
  857.             #define kQ3GeometryTypePoint                Q3_OBJECT_TYPE('p','n','t',' ')
  858.             #define kQ3GeometryTypePolygon                Q3_OBJECT_TYPE('p','l','y','g')
  859.             #define kQ3GeometryTypePolyLine                Q3_OBJECT_TYPE('p','l','y','l')
  860.             #define kQ3GeometryTypeTriangle                Q3_OBJECT_TYPE('t','r','n','g')
  861.             #define kQ3GeometryTypeTriGrid                Q3_OBJECT_TYPE('t','r','i','g')
  862.             #define kQ3GeometryTypeCone                    Q3_OBJECT_TYPE('c','o','n','e')
  863.             #define kQ3GeometryTypeCylinder                Q3_OBJECT_TYPE('c','y','l','n')
  864.             #define kQ3GeometryTypeDisk                    Q3_OBJECT_TYPE('d','i','s','k')
  865.             #define kQ3GeometryTypeEllipse                Q3_OBJECT_TYPE('e','l','p','s')
  866.             #define kQ3GeometryTypeEllipsoid            Q3_OBJECT_TYPE('e','l','p','d')
  867.             #define kQ3GeometryTypePolyhedron            Q3_OBJECT_TYPE('p','l','h','d')
  868.             #define kQ3GeometryTypeTorus                Q3_OBJECT_TYPE('t','o','r','s')
  869.             #define kQ3GeometryTypeTriMesh                Q3_OBJECT_TYPE('t','m','s','h')
  870.         #define kQ3ShapeTypeShader                        Q3_OBJECT_TYPE('s','h','d','r')
  871.             #define kQ3ShaderTypeSurface                Q3_OBJECT_TYPE('s','u','s','h')
  872.                 #define kQ3SurfaceShaderTypeTexture        Q3_OBJECT_TYPE('t','x','s','u')
  873.             #define kQ3ShaderTypeIllumination            Q3_OBJECT_TYPE('i','l','s','h')
  874.                 #define kQ3IlluminationTypePhong        Q3_OBJECT_TYPE('p','h','i','l')
  875.                 #define kQ3IlluminationTypeLambert        Q3_OBJECT_TYPE('l','m','i','l')
  876.                 #define kQ3IlluminationTypeNULL            Q3_OBJECT_TYPE('n','u','i','l')
  877.             #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  878.             #define kQ3ShaderTypeImage                    Q3_OBJECT_TYPE('i','m','s','h')
  879.             #define kQ3ShaderTypeTrim                    Q3_OBJECT_TYPE('t','r','s','h')
  880.             #define kQ3ShaderTypeAtmospheric            Q3_OBJECT_TYPE('a','t','s','h')
  881.             #endif  /*  ESCHER_VER_FUTURE  */
  882.         #define kQ3ShapeTypeStyle                        Q3_OBJECT_TYPE('s','t','y','l')
  883.             #define kQ3StyleTypeBackfacing                Q3_OBJECT_TYPE('b','c','k','f')
  884.             #define kQ3StyleTypeInterpolation            Q3_OBJECT_TYPE('i','n','t','p')
  885.             #define kQ3StyleTypeFill                    Q3_OBJECT_TYPE('f','i','s','t')
  886.             #define kQ3StyleTypePickID                    Q3_OBJECT_TYPE('p','k','i','d')
  887.             #define kQ3StyleTypeReceiveShadows            Q3_OBJECT_TYPE('r','c','s','h')
  888.             #define kQ3StyleTypeHighlight                Q3_OBJECT_TYPE('h','i','g','h')
  889.             #define kQ3StyleTypeSubdivision                Q3_OBJECT_TYPE('s','b','d','v')
  890.             #define kQ3StyleTypeOrientation                Q3_OBJECT_TYPE('o','f','d','r')
  891.             #define kQ3StyleTypePickParts                Q3_OBJECT_TYPE('p','k','p','t')
  892.             #define kQ3StyleTypeAntiAlias                Q3_OBJECT_TYPE('a','n','t','i')
  893.         #define kQ3ShapeTypeTransform                    Q3_OBJECT_TYPE('x','f','r','m')
  894.             #define kQ3TransformTypeMatrix                Q3_OBJECT_TYPE('m','t','r','x')
  895.             #define kQ3TransformTypeScale                Q3_OBJECT_TYPE('s','c','a','l')
  896.             #define kQ3TransformTypeTranslate            Q3_OBJECT_TYPE('t','r','n','s')
  897.             #define kQ3TransformTypeRotate                Q3_OBJECT_TYPE('r','o','t','t')
  898.             #define kQ3TransformTypeRotateAboutPoint     Q3_OBJECT_TYPE('r','t','a','p')
  899.             #define kQ3TransformTypeRotateAboutAxis     Q3_OBJECT_TYPE('r','t','a','a')
  900.             #define kQ3TransformTypeQuaternion            Q3_OBJECT_TYPE('q','t','r','n')
  901.             #define kQ3TransformTypeReset                Q3_OBJECT_TYPE('r','s','e','t')
  902.         #define kQ3ShapeTypeLight                        Q3_OBJECT_TYPE('l','g','h','t')
  903.             #define kQ3LightTypeAmbient                    Q3_OBJECT_TYPE('a','m','b','n')
  904.             #define kQ3LightTypeDirectional                Q3_OBJECT_TYPE('d','r','c','t')
  905.             #define kQ3LightTypePoint                    Q3_OBJECT_TYPE('p','n','t','l')
  906.             #define kQ3LightTypeSpot                    Q3_OBJECT_TYPE('s','p','o','t')
  907.         #define kQ3ShapeTypeCamera                        Q3_OBJECT_TYPE('c','m','r','a')
  908.             #define kQ3CameraTypeOrthographic            Q3_OBJECT_TYPE('o','r','t','h')
  909.             #define kQ3CameraTypeViewPlane                Q3_OBJECT_TYPE('v','w','p','l')
  910.             #define kQ3CameraTypeViewAngleAspect        Q3_OBJECT_TYPE('v','a','n','a')
  911.     
  912.         #define kQ3ShapeTypeGroup                        Q3_OBJECT_TYPE('g','r','u','p')
  913.             #define kQ3GroupTypeDisplay                    Q3_OBJECT_TYPE('d','s','p','g')
  914.                 #define kQ3DisplayGroupTypeOrdered        Q3_OBJECT_TYPE('o','r','d','g')
  915.                 #define kQ3DisplayGroupTypeIOProxy        Q3_OBJECT_TYPE('i','o','p','x')
  916.             #define kQ3GroupTypeLight                    Q3_OBJECT_TYPE('l','g','h','g')
  917.             #define kQ3GroupTypeInfo                    Q3_OBJECT_TYPE('i','n','f','o')
  918.         #define kQ3ShapeTypeUnknown                        Q3_OBJECT_TYPE('u','n','k','n')
  919.             #define kQ3UnknownTypeText                    Q3_OBJECT_TYPE('u','k','t','x')
  920.             #define kQ3UnknownTypeBinary                Q3_OBJECT_TYPE('u','k','b','n')
  921.         #define kQ3ShapeTypeReference                    Q3_OBJECT_TYPE('r','f','r','n')
  922.             #define kQ3ReferenceTypeExternal            Q3_OBJECT_TYPE('r','f','e','x')
  923.     #define kQ3SharedTypeSet                            Q3_OBJECT_TYPE('s','e','t',' ')
  924.         #define kQ3SetTypeAttribute                        Q3_OBJECT_TYPE('a','t','t','r')
  925.     #define kQ3SharedTypeDrawContext                    Q3_OBJECT_TYPE('d','c','t','x')
  926.         #define kQ3DrawContextTypePixmap                Q3_OBJECT_TYPE('d','p','x','p')
  927.         #if defined(WINDOW_SYSTEM_MACINTOSH) && WINDOW_SYSTEM_MACINTOSH
  928.         #define kQ3DrawContextTypeMacintosh                Q3_OBJECT_TYPE('d','m','a','c')
  929.         #endif  /*  WINDOW_SYSTEM_MACINTOSH  */
  930.         #if defined(WINDOW_SYSTEM_WIN32) && WINDOW_SYSTEM_WIN32
  931.         #define kQ3DrawContextTypeWin32DC                Q3_OBJECT_TYPE('d','w','3','2')
  932.         #define kQ3DrawContextTypeDDSurface                Q3_OBJECT_TYPE('d','d','d','s')
  933.         #endif  /*  WINDOW_SYSTEM_WIN32  */
  934.         #if defined(WINDOW_SYSTEM_X11) && WINDOW_SYSTEM_X11
  935.         #define kQ3DrawContextTypeX11                    Q3_OBJECT_TYPE('d','x','1','1')
  936.         #endif  /*  WINDOW_SYSTEM_X11  */
  937.         #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  938.         #define kQ3DrawContextTypeFile                    Q3_OBJECT_TYPE('d','f','i','l')
  939.         #endif  /*  ESCHER_VER_FUTURE  */
  940.     #define kQ3SharedTypeTexture                        Q3_OBJECT_TYPE('t','x','t','r')
  941.         #define kQ3TextureTypePixmap                    Q3_OBJECT_TYPE('t','x','p','m')
  942.         #define kQ3TextureTypeMipmap                    Q3_OBJECT_TYPE('t','x','m','m')
  943.         #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  944.         #if defined(WINDOW_SYSTEM_MACINTOSH) && WINDOW_SYSTEM_MACINTOSH
  945.         #define kQ3TextureTypeQuickdrawGX                Q3_OBJECT_TYPE('t','x','g','x')
  946.         #endif  /*  WINDOW_SYSTEM_MACINTOSH  */
  947.         #endif  /*  ESCHER_VER_FUTURE  */
  948.     #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  949.     #define kQ3SharedTypeAttachment                        Q3_OBJECT_TYPE('a','t','c','h')
  950.     #endif  /*  ESCHER_VER_FUTURE  */
  951.     #define kQ3SharedTypeFile                            Q3_OBJECT_TYPE('f','i','l','e')
  952.     #define kQ3SharedTypeStorage                        Q3_OBJECT_TYPE('s','t','r','g')
  953.         #define kQ3StorageTypeMemory                    Q3_OBJECT_TYPE('m','e','m','s')
  954.             #if defined(OS_MACINTOSH) && OS_MACINTOSH
  955.             #define kQ3MemoryStorageTypeHandle            Q3_OBJECT_TYPE('h','n','d','l')
  956.             #endif  /*  OS_MACINTOSH  */
  957.         #define kQ3StorageTypeUnix                        Q3_OBJECT_TYPE('u','x','s','t')
  958.             #define kQ3UnixStorageTypePath                Q3_OBJECT_TYPE('u','n','i','x')
  959.         #if defined(OS_MACINTOSH) && OS_MACINTOSH
  960.         #define kQ3StorageTypeMacintosh                    Q3_OBJECT_TYPE('m','a','c','n')
  961.             #define kQ3MacintoshStorageTypeFSSpec        Q3_OBJECT_TYPE('m','a','c','p')                    
  962.         #endif  /*  OS_MACINTOSH  */
  963.         #if defined(OS_WIN32) && OS_WIN32
  964.         #define kQ3StorageTypeWin32                        Q3_OBJECT_TYPE('w','i','s','t')
  965.         #endif  /*  OS_WIN32  */
  966.     #define kQ3SharedTypeString                            Q3_OBJECT_TYPE('s','t','r','n')
  967.         #define kQ3StringTypeCString                    Q3_OBJECT_TYPE('s','t','r','c')
  968.         #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  969.         #define kQ3StringTypeUnicode                    Q3_OBJECT_TYPE('u','n','c','d')
  970.         #if defined(OS_MACINTOSH) && OS_MACINTOSH
  971.         #define kQ3StringTypeWorldScript                Q3_OBJECT_TYPE('s','c','r','p')
  972.         #endif  /*  OS_MACINTOSH  */
  973.         #endif  /*  ESCHER_VER_FUTURE  */
  974.     #define kQ3SharedTypeShapePart                        Q3_OBJECT_TYPE('s','p','r','t')
  975.         #define kQ3ShapePartTypeMeshPart                Q3_OBJECT_TYPE('s','p','m','h')
  976.             #define kQ3MeshPartTypeMeshFacePart            Q3_OBJECT_TYPE('m','f','a','c')
  977.             #define kQ3MeshPartTypeMeshEdgePart            Q3_OBJECT_TYPE('m','e','d','g')
  978.             #define kQ3MeshPartTypeMeshVertexPart        Q3_OBJECT_TYPE('m','v','t','x')
  979.     #define kQ3SharedTypeControllerState                Q3_OBJECT_TYPE('c','t','s','t')
  980.     #define kQ3SharedTypeTracker                        Q3_OBJECT_TYPE('t','r','k','r')
  981.     #define kQ3SharedTypeViewHints                        Q3_OBJECT_TYPE('v','w','h','n')
  982.     #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  983.     #define kQ3SharedTypeDeepBuffer                        Q3_OBJECT_TYPE('d','e','e','p')
  984.     #define kQ3SharedTypeColorTable                        Q3_OBJECT_TYPE('c','l','u','t')
  985.     #endif /*  ESCHER_VER_FUTURE  */
  986.     #define kQ3SharedTypeEndGroup                        Q3_OBJECT_TYPE('e','n','d','g')
  987.  
  988.  
  989. #ifdef __cplusplus
  990. extern "C" {
  991. #endif    /* __cplusplus */
  992.  
  993. /******************************************************************************
  994.  **                                                                             **
  995.  **                            QuickDraw 3D System Routines                     **
  996.  **                                                                             **
  997.  *****************************************************************************/
  998.  
  999. QD3D_EXPORT TQ3Status QD3D_CALL Q3Initialize(
  1000.     void);
  1001.  
  1002. QD3D_EXPORT TQ3Status QD3D_CALL Q3Exit(
  1003.     void);
  1004.  
  1005. QD3D_EXPORT TQ3Boolean QD3D_CALL Q3IsInitialized(
  1006.     void);
  1007.  
  1008. QD3D_EXPORT TQ3Status QD3D_CALL Q3GetVersion(
  1009.     unsigned long        *majorRevision,
  1010.     unsigned long        *minorRevision);
  1011.  
  1012.  
  1013. /******************************************************************************
  1014.  **                                                                             **
  1015.  **                            ObjectClass Routines                             **
  1016.  **                                                                             **
  1017.  *****************************************************************************/
  1018.  
  1019. #if defined(QD3D_OBSOLETE) && QD3D_OBSOLETE
  1020.  
  1021. /*
  1022.  *  Q3ObjectClass_Unregister is an obsolete function.  For the new extensions 
  1023.  *  model you should now use Q3XObjectHierarchy_UnregisterClass which is 
  1024.  *  defined in QD3DExtension.h and takes identical parameters.
  1025.  */
  1026. QD3D_EXPORT TQ3Status QD3D_CALL Q3ObjectClass_Unregister(
  1027.     TQ3ObjectClass        objectClass);
  1028.  
  1029. #endif  /*  QD3D_OBSOLETE  */
  1030.  
  1031. /* 
  1032.  *  New object system calls to query the object system.
  1033.  *
  1034.  *  These comments to move to the stubs file before final release, they 
  1035.  *  are here for documentation for developers using early seeds.
  1036.  */
  1037.  
  1038. /*
  1039.  *  Given a class name as a string return the associated class type for the 
  1040.  *  class, may return kQ3Failure if the string representing the class is 
  1041.  *  invalid.
  1042.  */
  1043. QD3D_EXPORT TQ3Status QD3D_CALL Q3ObjectHierarchy_GetTypeFromString(
  1044.     TQ3ObjectClassNameString    objectClassString, 
  1045.     TQ3ObjectType                 *objectClassType);
  1046.     
  1047. /*
  1048.  *  Given a class type as return the associated string for the class name, 
  1049.  *  may return kQ3Failure if the type representing the class is invalid.
  1050.  */
  1051. QD3D_EXPORT TQ3Status QD3D_CALL Q3ObjectHierarchy_GetStringFromType(
  1052.     TQ3ObjectType                objectClassType, 
  1053.     TQ3ObjectClassNameString     objectClassString);
  1054.  
  1055. /* 
  1056.  *  Return true if the class with this type is registered, false if not 
  1057.  */
  1058. QD3D_EXPORT TQ3Boolean QD3D_CALL Q3ObjectHierarchy_IsTypeRegistered(
  1059.     TQ3ObjectType                objectClassType);
  1060.  
  1061. /* 
  1062.  *  Return true if the class with this name is registered, false if not 
  1063.  */
  1064. QD3D_EXPORT TQ3Boolean QD3D_CALL Q3ObjectHierarchy_IsNameRegistered(
  1065.     const char                    *objectClassName);
  1066.  
  1067. /*
  1068.  * TQ3SubClassData is used when querying the object system for
  1069.  * the subclasses of a particular parent type:
  1070.  */
  1071. typedef struct TQ3SubClassData {
  1072.     unsigned long         numClasses;        /* the # of subclass types found */
  1073.                                         /* for a parent class              */
  1074.     TQ3ObjectType        *classTypes;    /* an array containing the class */
  1075.                                         /* types                         */
  1076. } TQ3SubClassData;
  1077.  
  1078. /*
  1079.  *  Given a parent type and an instance of the TQ3SubClassData struct fill
  1080.  *  it in with the number and class types of all of the subclasses immediately
  1081.  *  below the parent in the class hierarchy.  Return kQ3Success to indicate no
  1082.  *  errors occurred, else kQ3Failure.
  1083.  *
  1084.  *  NOTE:  This function will allocate memory for the classTypes array.  Be 
  1085.  *    sure to call Q3ObjectClass_EmptySubClassData to free this memory up.
  1086.  */
  1087. QD3D_EXPORT TQ3Status QD3D_CALL Q3ObjectHierarchy_GetSubClassData(
  1088.     TQ3ObjectType                objectClassType, 
  1089.     TQ3SubClassData                *subClassData);
  1090.  
  1091. /*
  1092.  *  Given an instance of the TQ3SubClassData struct free all memory allocated 
  1093.  *    by the Q3ObjectClass_GetSubClassData call.
  1094.  *
  1095.  *  NOTE: This call MUST be made after a call to Q3ObjectClass_GetSubClassData
  1096.  *  to avoid memory leaks.
  1097.  */
  1098. QD3D_EXPORT TQ3Status QD3D_CALL Q3ObjectHierarchy_EmptySubClassData(
  1099.     TQ3SubClassData                *subClassData);
  1100.  
  1101.  
  1102. /******************************************************************************
  1103.  **                                                                             **
  1104.  **                                Object Routines                                 **
  1105.  **                                                                             **
  1106.  *****************************************************************************/
  1107.  
  1108. QD3D_EXPORT TQ3Status QD3D_CALL Q3Object_Dispose(
  1109.     TQ3Object             object);
  1110.     
  1111. QD3D_EXPORT TQ3Object QD3D_CALL Q3Object_Duplicate(
  1112.     TQ3Object            object);
  1113.     
  1114. QD3D_EXPORT TQ3Status QD3D_CALL Q3Object_Submit(
  1115.     TQ3Object            object,
  1116.     TQ3ViewObject        view);
  1117.     
  1118. QD3D_EXPORT TQ3Boolean QD3D_CALL Q3Object_IsDrawable(
  1119.     TQ3Object            object);
  1120.  
  1121. QD3D_EXPORT TQ3Boolean QD3D_CALL Q3Object_IsWritable(
  1122.     TQ3Object            object,
  1123.     TQ3FileObject        file);
  1124.  
  1125.  
  1126. /******************************************************************************
  1127.  **                                                                             **
  1128.  **                            Object Type Routines                             **
  1129.  **                                                                             **
  1130.  *****************************************************************************/
  1131.  
  1132. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3Object_GetType(
  1133.     TQ3Object            object);
  1134.  
  1135. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3Object_GetLeafType(
  1136.     TQ3Object            object);
  1137.  
  1138. QD3D_EXPORT TQ3Boolean QD3D_CALL Q3Object_IsType(
  1139.     TQ3Object            object,
  1140.     TQ3ObjectType        type);
  1141.  
  1142.  
  1143. /******************************************************************************
  1144.  **                                                                             **
  1145.  **                            Shared Object Routines                             **
  1146.  **                                                                             **
  1147.  *****************************************************************************/
  1148.  
  1149. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3Shared_GetType(
  1150.     TQ3SharedObject     sharedObject);
  1151.  
  1152. QD3D_EXPORT TQ3SharedObject QD3D_CALL Q3Shared_GetReference(
  1153.     TQ3SharedObject     sharedObject);
  1154.  
  1155. /* 
  1156.  *    Q3Shared_IsReferenced
  1157.  *        Returns kQ3True if there is more than one reference to sharedObject.
  1158.  *        Returns kQ3False if there is ONE reference to sharedObject.
  1159.  *    
  1160.  *    This call is intended to allow applications and plug-in objects to delete
  1161.  *    objects of which they hold THE ONLY REFERENCE. This is useful when
  1162.  *    caching objects, etc.
  1163.  *    
  1164.  *    Although many may be tempted, DO NOT DO THIS:
  1165.  *        while (Q3Shared_IsReferenced(foo)) { Q3Object_Dispose(foo); }
  1166.  *    
  1167.  *    Your application will crash and no one will buy it. Chapter 11 is 
  1168.  *    never fun (unless you short the stock). Thanks.
  1169.  */
  1170. QD3D_EXPORT TQ3Boolean QD3D_CALL Q3Shared_IsReferenced(
  1171.     TQ3SharedObject         sharedObject);
  1172.  
  1173. /*
  1174.  *    Q3Shared_GetEditIndex
  1175.  *        Returns the "serial number" of sharedObject. Usefuly for caching 
  1176.  *        object information. Returns 0 on error.
  1177.  *        
  1178.  *        Hold onto this number to determine if an object has changed since you
  1179.  *        last built your caches... To validate, do:
  1180.  *        
  1181.  *        if (Q3Shared_GetEditIndex(foo) == oldFooEditIndex) {
  1182.  *            // Cache is valid
  1183.  *        } else {
  1184.  *            // Cache is invalid
  1185.  *            RebuildSomeSortOfCache(foo);
  1186.  *            oldFooEditIndex = Q3Shared_GetEditIndex(foo);
  1187.  *        }
  1188.  */
  1189. QD3D_EXPORT unsigned long QD3D_CALL Q3Shared_GetEditIndex(
  1190.     TQ3SharedObject         sharedObject);
  1191.  
  1192. /*
  1193.  *    Q3Shared_Edited
  1194.  *        Bumps the "serial number" of sharedObject to a different value. This
  1195.  *        call is intended to be used solely from a plug-in object which is 
  1196.  *        shared. Call this whenever your private instance data changes.
  1197.  *        
  1198.  *        Returns kQ3Failure iff sharedObject is not a shared object, OR
  1199.  *            QuickDraw 3D isn't initialized.
  1200.  */
  1201. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shared_Edited(
  1202.     TQ3SharedObject         sharedObject);
  1203.  
  1204.  
  1205. /******************************************************************************
  1206.  **                                                                             **
  1207.  **                                Shape Routines                                 **
  1208.  **                                                                             **
  1209.  *****************************************************************************/
  1210.  
  1211. /*
  1212.  *    QuickDraw 3D 1.1 Note:
  1213.  *
  1214.  *    Shapes and Sets are now (sort of) polymorphic.
  1215.  *
  1216.  *        You may call Q3Shape_Foo or Q3Set_Foo on a shape or a set.
  1217.  *        The following calls are identical, in implementation:
  1218.  *
  1219.  *            Q3Shape_GetElement            =    Q3Set_Get
  1220.  *            Q3Shape_AddElement            =    Q3Set_Add
  1221.  *            Q3Shape_ContainsElement        =    Q3Set_Contains
  1222.  *            Q3Shape_GetNextElementType    =    Q3Set_GetNextElementType
  1223.  *            Q3Shape_EmptyElements        =    Q3Set_Empty
  1224.  *            Q3Shape_ClearElement        =    Q3Set_Clear
  1225.  *
  1226.  *    All of these calls accept a shape or a set as their first parameter.
  1227.  *
  1228.  *    The Q3Shape_GetSet and Q3ShapeSetSet calls are implemented via a new
  1229.  *    element type kQ3ElementTypeSet. See the note above about 
  1230.  *    kQ3ElementTypeSet;
  1231.  *
  1232.  *    It is important to note that the new Q3Shape_...Element... calls do not
  1233.  *    create a set on a shape and then add the element to it. This data is
  1234.  *    attached directly to the shape. Therefore, it is possible for an element
  1235.  *    to exist on a shape without a set existing on it as well. 
  1236.  *
  1237.  *    In your application, if you attach an element to a shape like this:
  1238.  *        (this isn't checking for errors for simplicity)
  1239.  *
  1240.  *        set = Q3Set_New();
  1241.  *        Q3Set_AddElement(set, kMyElemType, &data);
  1242.  *        Q3Shape_SetSet(shape, set);
  1243.  *
  1244.  *    You should retrieve it in the same manner:
  1245.  *
  1246.  *        Q3Shape_GetSet(shape, &set);
  1247.  *        if (Q3Set_Contains(set, kMyElemType) == kTrue) {
  1248.  *            Q3Set_Get(set, kMyElemType, &data);
  1249.  *        }
  1250.  *
  1251.  *    Similarly, if you attach data to a shape with the new calls:
  1252.  *
  1253.  *        Q3Shape_AddElement(shape, kMyElemType, &data);
  1254.  *
  1255.  *    You should retrieve it in the same manner:
  1256.  *
  1257.  *        if (Q3Shape_ContainsElement(set, kMyElemType) == kTrue) {
  1258.  *            Q3Shape_GetElement(set, kMyElemType, &data);
  1259.  *        }
  1260.  *
  1261.  *    This really becomes an issue when dealing with version 1.0 and version 1.1 
  1262.  *    metafiles.
  1263.  *
  1264.  *    When attempting to find a particular element on a shape, you should
  1265.  *    first check with Q3Shape_GetNextElementType or Q3Shape_GetElement, then,
  1266.  *    Q3Shape_GetSet(s, &set) (or Q3Shape_GetElement(s, kQ3ElementTypeSet, &set))
  1267.  *    and then Q3Shape_GetElement(set, ...).
  1268.  *
  1269.  *    In terms of implementation, Q3Shape_SetSet and Q3Shape_GetSet should only be
  1270.  *    used for sets of information that are shared among multiple shapes.
  1271.  *    
  1272.  *    Q3Shape_AddElement, Q3Shape_GetElement, etc. calls should only be used
  1273.  *    for elements that are unique for a particular shape.
  1274.  *    
  1275.  */
  1276. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3Shape_GetType(
  1277.     TQ3ShapeObject    shape);
  1278.  
  1279. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shape_GetSet(
  1280.     TQ3ShapeObject    shape,
  1281.     TQ3SetObject    *set);
  1282.  
  1283. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shape_SetSet(
  1284.     TQ3ShapeObject    shape,
  1285.     TQ3SetObject     set);
  1286.  
  1287. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shape_AddElement(
  1288.     TQ3ShapeObject    shape,
  1289.     TQ3ElementType    type,
  1290.     const void        *data);
  1291.  
  1292. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shape_GetElement(
  1293.     TQ3ShapeObject    shape,
  1294.     TQ3ElementType    type,
  1295.     void            *data);
  1296.     
  1297. QD3D_EXPORT TQ3Boolean QD3D_CALL Q3Shape_ContainsElement(
  1298.     TQ3ShapeObject    shape,
  1299.     TQ3ElementType    type);
  1300.  
  1301. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shape_GetNextElementType(
  1302.     TQ3ShapeObject    shape,
  1303.     TQ3ElementType    *type);
  1304.  
  1305. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shape_EmptyElements(
  1306.     TQ3ShapeObject    shape);
  1307.  
  1308. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shape_ClearElement(
  1309.     TQ3ShapeObject    shape,
  1310.     TQ3ElementType    type);
  1311.  
  1312.  
  1313. /******************************************************************************
  1314.  **                                                                             **
  1315.  **                            Color Table Routines                             **
  1316.  **                                                                             **
  1317.  *****************************************************************************/
  1318.  
  1319. #if defined(ESCHER_VER_FUTURE) && ESCHER_VER_FUTURE
  1320.  
  1321. #if 0
  1322. /* If'ed out so linker doesn't complain */
  1323.  
  1324. QD3D_EXPORT TQ3ColorTableObject QD3D_CALL Q3ColorTable_New(
  1325.     const TQ3ColorTableData        *colorTableData);
  1326.  
  1327. QD3D_EXPORT TQ3Status QD3D_CALL Q3ColorTable_Set(
  1328.     TQ3ColorTableObject            colorTable,
  1329.     const TQ3ColorTableData        *colorTableData);
  1330.  
  1331. QD3D_EXPORT TQ3Status QD3D_CALL Q3ColorTable_Get(
  1332.     TQ3ColorTableObject            colorTable,
  1333.     const TQ3ColorTableData        *colorTableData);
  1334.  
  1335. QD3D_EXPORT TQ3Status QD3D_CALL Q3ColorTable_SetType(
  1336.     TQ3ColorTableObject            colorTable,
  1337.     TQ3ColorTableType            colorTableType);
  1338.  
  1339. QD3D_EXPORT TQ3Status QD3D_CALL Q3ColorTable_GetType(
  1340.     TQ3ColorTableObject            colorTable,
  1341.     TQ3ColorTableType            *colorTableType);
  1342.  
  1343. QD3D_EXPORT TQ3Status QD3D_CALL Q3ColorTable_SetTransparent(
  1344.     TQ3ColorTableObject            colorTable,
  1345.     TQ3Boolean                    hasTransparent);
  1346.  
  1347. QD3D_EXPORT TQ3Status QD3D_CALL Q3ColorTable_GetTransparent(
  1348.     TQ3ColorTableObject            colorTable,
  1349.     TQ3Boolean                    *hasTransparent);
  1350.  
  1351. QD3D_EXPORT TQ3Status QD3D_CALL Q3ColorTable_SetColors(
  1352.     TQ3ColorTableObject            colorTable,
  1353.     unsigned long                startIndex,
  1354.     unsigned long                count,
  1355.     const TQ3ColorRGB32            *colors);
  1356.  
  1357. QD3D_EXPORT TQ3Status QD3D_CALL Q3ColorTable_GetColors(
  1358.     TQ3ColorTableObject            colorTable,
  1359.     unsigned long                startIndex,
  1360.     unsigned long                count,
  1361.     TQ3ColorRGB32                *colors);
  1362.  
  1363. QD3D_EXPORT void QD3D_CALL Q3ColorRGB32_Set(
  1364.     TQ3ColorRGB32            *colorRGB32,
  1365.     unsigned char            r,
  1366.     unsigned char            g,
  1367.     unsigned char            b);
  1368.  
  1369. QD3D_EXPORT void QD3D_CALL Q3ColorRGB32_Get(
  1370.     TQ3ColorRGB32            colorRGB32,
  1371.     unsigned char            *r,
  1372.     unsigned char            *g,
  1373.     unsigned char            *b);
  1374. #endif  /*  0  */
  1375. #endif /* ESCHER_VER_FUTURE */
  1376.  
  1377. QD3D_EXPORT TQ3Status QD3D_CALL Q3Bitmap_Empty(
  1378.     TQ3Bitmap            *bitmap);
  1379.  
  1380. QD3D_EXPORT unsigned long QD3D_CALL Q3Bitmap_GetImageSize(
  1381.     unsigned long        width,
  1382.     unsigned long        height);
  1383.  
  1384. #ifdef __cplusplus
  1385. }
  1386. #endif  /*  __cplusplus  */
  1387.  
  1388. #if defined(THINK_C) || defined(__SC__)
  1389.     #pragma SC options align=reset
  1390. #elif defined(__MWERKS__)
  1391.     #pragma enumsalwaysint reset
  1392.     #pragma align_array_members reset
  1393.     #pragma options align=reset
  1394. #elif  defined(__PPCC__)
  1395.     #pragma options align=reset
  1396. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  1397.     #pragma options enum=reset
  1398. #endif
  1399.  
  1400. #endif /*  QD3D_h  */
  1401.  
  1402.